package com.forevershine.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.cohesion.bootstrap.common.MemoryCacheImpl;
import com.forevershine.business.context.ContextBuilder;
import com.forevershine.business.model.StyleDetail;
import com.forevershine.business.service.AbstractService;
import com.forevershine.business.service.impl.EmployeeServiceImpl;
import com.forevershine.common.BusinessConstants;
import com.forevershine.personel.model.Employee;

public class AdminPanelAction extends BaseAction {

	private static Log log = LogFactory.getLog(AdminPanelAction.class);

	
	private StyleDetail briefVo = new StyleDetail();
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private AbstractService service;

	private List employeeList = new ArrayList();

	public List getEmployeeList() {
		return employeeList;
	}

	public void setEmployeeList(List employeeList) {
		this.employeeList = employeeList;
	}

	private Employee employee;

	public StyleDetail getBriefVoModel() {
		return briefVo;
	}

	public void setBriefVoModel(StyleDetail model) {
		this.briefVo = model;
	}

	private void loadDefaultMenu() {

	}

	@Override
	protected String service() {
		loadEmployeeList(employeeList);
		return SUCCESS;
	}

	private void loadEmployeeList(List employeeList) {
		this.service = ContextBuilder.getContext().getInstance(
				EmployeeServiceImpl.class);
		((EmployeeServiceImpl)service).loadAllEmployees(employeeList);
	}
	
	
	public List getCategory()
	{
		return (List)MemoryCacheImpl.INSTANCE.get(BusinessConstants.CATEGORY);
	}

}
